package com.xshbbs.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xshbbs.dao.BlockMapper;
import com.xshbbs.entity.Block;
import com.xshbbs.entity.Partition;
import com.xshbbs.service.BlockService;

@Service
public class BlockServiceImpl implements BlockService {
	
	@Autowired
	private BlockMapper blockMapper;
	
	@Override 
	public String admit(Block block) {
		
		if(block.getName() == "" || block.getName().equals("")) {
			return "版块名不能为空";
		}
		return "1";
		
	}
	
	@Override
	public Block selectBlockById(Integer id) {
		return this.blockMapper.selectBlockById(id);
	}

	@Override
	public boolean insertBlock(Block block) {
		return this.blockMapper.insertBlock(block);
	}

	@Override
	public boolean deleteBlockById(Integer id) {
		return this.blockMapper.deleteBlockById(id);
	}

	@Override
	public boolean updateBlockById(Block block) {
		return this.blockMapper.updateBlockById(block);
	}
	
	
	
}
